import request from '@/utils/request';

export function getCortList() {
    return request({
        url: '/v1/goods/cornermark/list',
        method: 'post',
        data: {}
    });
}

export function createCort(data) {
    return request({
        url: '/v1/goods/cornermark/create',
        method: 'post',
        header: {
            'Content-Type': 'multipart/form-data;charset=utf-8'
        },
        data
    });
}

export function updateCort(id, file) {
    return request({
        url: `/v1/goods/cornermark/update/${id}`,
        method: 'post',
        header: {
            'Content-Type': 'multipart/form-data;charset=utf-8'
        },
        data: file
    });
}

export function deleteCort(id) {
    return request({
        url: `/v1/goods/cornermark/delete/${id}`,
        method: 'delete'
    });
}

export function getUnitList() {
    return request({
        url: '/v1/goods/unit/list',
        method: 'post',
        data: {
            countSql: true,
            pageNum: 0,
            pageNumber: 0,
            pageSize: 100,
            pageSizeZero: true,
            reasonable: true
        }
    });
}

export function createUnit(name) {
    return request({
        url: '/v1/goods/unit/create',
        method: 'post',
        data: {
            name
        }
    });
}

export function updateUnit(id, name) {
    return request({
        url: '/v1/goods/unit/update',
        method: 'post',
        data: {
            id,
            name
        }
    });
}

export function deleteUnit(id) {
    return request({
        url: `/v1/goods/unit/delete/${id}`,
        method: 'delete'
    });
}
